import java.util.Scanner;

public class Test10 {
    public static int sum(int[] a) {
        int total = 0;
        for (int num : a) {
            total += num;
        }
        return total;
    }
    public static int sum(int[] a, int start) {
        int total = 0;
        for (int i = start; i < a.length; i++) {
            total += a[i];
        }
        return total;
    }
    public static int sum(int[] a, int start, int end) {
        int total = 0;
        for (int i = start; i < end; i++) {
            total += a[i];
        }
        return total;
    }

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[] a = new int[10];
        int start, end;
        for (int i = 0; i < a.length; i++) {
            a[i] = input.nextInt();
        }
        System.out.println(sum(a));
        start = input.nextInt();
        System.out.println(sum(a, start));
        start = input.nextInt();
        end = input.nextInt();
        System.out.println(sum(a, start, end));
        input.close();
    }
}